/*
 * SocketTCP.h
 *
 *  Created on: Jan 23, 2013
 *      Author: murilo
 */

#ifndef SOCKETTCP_H_
#define SOCKETTCP_H_

#include <iostream>
#include "Sys_Socket.hpp"
#include <string>
#include <cstring>

class Socket_TCP {
	public:
		Socket_TCP(std::string host,std::string port);
		virtual ~Socket_TCP();

		void connectTo();
		void sendMsg(std::string msg);
		std::string recvMsg();
		std::string recvMsg(size_t size);
		bool isConnected();
	private:
		bool connected;
		//no caso AF_INET
		addrinfo sockType,*serverInfo;
		int socketInfo;
		std::string host;
		std::string port;
};

#endif /* SOCKETTCP_H_ */
